package top.lilele.adminSystem.entity;


import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author lilele
 */
@TableName(value = "admin_department")
@Data
public class AdminDepartmentEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     *
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 部门名称
     */
    @NotEmpty(message = "部门名称不能为空")
    @Length(max = 30, message = "部门名称最多30个字符")
    @TableField(value = "departmentName")
    private String departmentName;

    /**
     * 父级部门id
     */
    @TableField(value = "parentId")
    private String parentId;

    /**
     * 排序
     */
    @TableField(value = "sort")
    private Integer sort;

    @TableField(value = "createdTime", fill = FieldFill.INSERT)
    private Date createdTime;
    @TableField(value = "updatedTime", fill = FieldFill.UPDATE)
    private Date updatedTime;

    @TableField(exist = false)
    private List<AdminDepartmentEntity> children;
}